// Load the language file
tinyMCE.importPluginLanguagePack('wpPageLinker', '');

var TinyMCE_wpPageLinkerPlugin = {
	getInfo : function() {
		return {
			longname : 'Wordpress Page Linker',
			author : 'Tiago Pocinho',
			authorurl : 'http://code.google.com/u/tiago.pocinho',
			infourl : 'http://code.google.com/p/wp-page-linker',
			version : '1.0 RC1'
		};
	},
	getControlHTML : function(cn) {
		switch (cn) {
			//add the button to the editor
			case "wpPageLinker":
			return tinyMCE.getButtonHTML(cn, 'lang_wpPageLinker_desc', '{$pluginurl}/button.gif', 'mcewpPageLinker');
		}
		return "";
	},
	execCommand : function(editor_id, element, command, user_interface, value) {
		switch (command) {
			// If it is our plugin we must handle the action
			case "mcewpPageLinker":
				// Call the script
				wpPageLinker_buttonscript();
				return true;
		}
		return false;
	}
};


// Adds the plugin class to the list of available TinyMCE plugins
tinyMCE.addPlugin("wpPageLinker", TinyMCE_wpPageLinkerPlugin );